package com.qf.mapper;

import com.qf.entity.ReserveMeet;
import com.qf.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.format.annotation.DateTimeFormat;
import tk.mybatis.mapper.common.Mapper;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

public interface ReserveMeetMapper extends Mapper<ReserveMeet>{

    @Select("select meet_id from reserve_meet where #{startTime} between start_time and end_time or #{endTime} between start_time and end_time or start_time between #{startTime} and #{endTime} and audit_status != 2 ")
    HashSet<Integer> reserveIds(@Param("startTime") String startTime, @Param("endTime") String endTime);

    //添加预定会议室记录
    Integer saveRecord( ReserveMeet reserveMeet);

    List<ReserveMeet> findInfoLike(ReserveMeet reserveMeet);

    //查找预定会议室申请
    ReserveMeet findInfo(@Param("taskId") Integer taskId,@Param("eventId") Integer eventId);


}
